a11y: Don't crete cell infos for non-children
authorBenjamin Otte <otte@redhat.com>
Sun, 13 Nov 2011 01:47:42 +0000 (02:47 +0100)
committerBenjamin Otte <otte@redhat.com>
Wed, 16 Nov 2011 03:39:24 +0000 (04:39 +0100)
When we use a container inbetween, this ensures that the cell infos
don't replace each other in the hash table.

gtk/a11y/gtktreeviewaccessible.c

index 51d8167bee2a36c3483a48626862e9cc7c742877..794233b3edd5a113c1d412c99c11a24cb15d694b 100644 (file)
@@ -682,7 +682,8 @@ gtk_tree_view_accessible_ref_child (AtkObject *obj,
           renderer_cell = GTK_RENDERER_CELL_ACCESSIBLE (child);
 
           /* Create the GtkTreeViewAccessibleCellInfo for this cell */
-          cell_info_new (accessible, tree_model, tree, node, tv_col, cell);
+          if (parent == ATK_OBJECT (accessible))
+            cell_info_new (accessible, tree_model, tree, node, tv_col, cell);
 
           _gtk_cell_accessible_initialise (cell, widget, parent);
 
@@ -3317,8 +3318,17 @@ find_cell_info (GtkTreeViewAccessible *accessible,
                 GtkCellAccessible     *cell,
                 gboolean               live_only)
 {
+  AtkObject *parent;
+  
+  parent = atk_object_get_parent (ATK_OBJECT (cell));
+  while (parent != ATK_OBJECT (accessible))
+    {
+      cell = GTK_CELL_ACCESSIBLE (parent);
+      parent = atk_object_get_parent (ATK_OBJECT (cell));
+    }
+
   return g_object_get_qdata (G_OBJECT (cell),
-                                  gtk_tree_view_accessible_get_data_quark ());
+                             gtk_tree_view_accessible_get_data_quark ());
 }
 
 static AtkObject *